package com.example.demo.entity;

import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 订单主表(Order)表实体类
 *
 * @author ElonChung
 * @since 2020-05-12 20:45:39
 */
@SuppressWarnings("serial")
@Data
@TableName("`tb_order`")
public class Order extends Model<Order> {
    private static final long serialVersionUID = -67019544815779888L;
    /**
    * id
    */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty( name ="id", value="id")
    private Integer id;
    /**
    * 订单编号
    */    
    @ApiModelProperty( name ="orderSn", value="订单编号")
    private String orderSn;
    /**
    * 总价格
    */    
    @ApiModelProperty( name ="price", value="总价格")
    private BigDecimal price;
    /**
    * 总数量
    */    
    @ApiModelProperty( name ="count", value="总数量")
    private Integer count;
    /**
    * 用户id
    */    
    @ApiModelProperty( name ="uid", value="用户id")
    private Integer uid;
    /**
    * 订单状态
    */    
    @ApiModelProperty( name ="status", value="订单状态")
    private Integer status;
    /**
    * 备注
    */    
    @ApiModelProperty( name ="remark", value="备注")
    private String remark;
    /**
    * 创建时间
    */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
    * 版本
    */    
    @ApiModelProperty( name ="version", value="版本")
    private Integer version;
    /**
    * 是否删除 0否 1是
    */    
    @ApiModelProperty( name ="deleted", value="是否删除 0否 1是")
    private Integer deleted;

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    protected Serializable pkVal() {
        return this.id;
    }
    }